package day05;

/*
 * Author: JacksonCoder
 * FileName: OverloadOverrideDemo
 * Version: 1.0.0
 * Date: 2025/4/12
 */
class Overload{

    public int add(int a, int b){
        return a + b;
    }

    public double add(double a, double b){
        return a + b;
    }
}

class OverrideClass{
    public void print(){
        System.out.println("父类方法");
    }

    public void speek(){
        System.out.println("父类speek");
    }
}

class PrintClass extends OverrideClass{
    @Override
    public void print(){
        System.out.println("子类方法");
    }

//    public void speek(){
//        System.out.println("子类speek");
//    }

}


public class OverloadOverrideDemo {

    public static void main(String[] args) {
        Overload o = new Overload();
        System.out.println(o.add(1, 2));
        System.out.println(o.add(63.131, 564.2132));

        PrintClass p = new PrintClass();
        p.print();
        p.speek();
    }

}
